package com.module.antiFake;

import java.util.HashMap;
import java.util.Map;

import base.util.ConstantUnit;

import com.module.antiFake.manager.AntiFakeOrgConfigManager;
import com.module.antiFake.vo.AntiFakeOrgConfig;
import com.module.sys.LoginSession;

public class AntiFakeOrgConfigService {
	
	/**
	 * 查询企业扫码预警设置
	 * @return
	 */
	public AntiFakeOrgConfig findOrgConfig(){
		try {
			AntiFakeOrgConfigManager antiFakeOrgConfigManager = AntiFakeOrgConfigManager.getInstance();
			AntiFakeOrgConfig form = antiFakeOrgConfigManager.findOrgConfig(LoginSession.getOrgid());
			return form;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}
	/**
	 * 保存或者更新企业扫码预警设置
	 * @param antiFakeOrgConfig
	 * @return
	 */
	public boolean saveOrUpdateConfig(AntiFakeOrgConfig antiFakeOrgConfig){
		try {
				antiFakeOrgConfig.setOrgid(LoginSession.getOrgid());
				AntiFakeOrgConfigManager antiFakeOrgConfigManager = AntiFakeOrgConfigManager.getInstance();
				boolean isTrue = antiFakeOrgConfigManager.saveOrUpdateConfig(antiFakeOrgConfig);
				return isTrue;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}

}
